<?php

   require_once '../../../plugins/db.php';
   $db = new Db();
   
   
   $fl = fopen('ips_utf8.txt', 'r');
   //$space = '	 ';
   $space = "  ";
   while (!feof($fl)){
   	 $row = fgets($fl);
   	 $row = trim($row);
   	 //echo 'sdfs'.$row;
   	 
   	 $index = strpos($row, $space);
   	 echo 'index:'.$index;
   	 $first = substr($row, 0, $index);
   	 
   	 $row = substr($row, $index);
   	 $row = trim($row);
   	 
   	 $index = strpos($row, $space);
   	 $second = substr($row, 0, $index);
   	 
   	 $three = trim(substr($row, $index));
   	 
   	 $insertSql = "insert into test(ip_start,ip_end,address) values('$first','$second','$three')";
   	 
   	 $db->query($insertSql);
   	 
   	 echo " ff $first_$second_$three".'\r\n';
   }
   
   fclose($fl);


?>